public class Demo1 {
    public String removeTrailingZeros(String num) {
       int x =num.lastIndexOf("0",num.length());
     StringBuilder s=new StringBuilder();
              s.append(num);
        s.delete(x,num.length()+1);
     return String.valueOf(s);

    }
}
